class AabException(Exception):
    def __init__(self, status_code, message):
        super(Exception, self).__init__(message)
        self.status_code = status_code
        self.message = message

    def to_response(self):
        from .utils import jsonify_error
        return jsonify_error(self.status_code, message=self.message)


